package com.crocodileQ.blog.service.impl;

import java.util.List;

import com.crocodileQ.blog.domain.dto.BlogArticleTagsDto;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.crocodileQ.blog.mapper.BlogArticleTagsMapper;
import com.crocodileQ.blog.domain.BlogArticleTags;
import com.crocodileQ.blog.service.IBlogArticleTagsService;

/**
 * tagsService业务层处理
 * 
 * @author crocodilePole
 * @date 2025-04-10
 */
@Service
public class BlogArticleTagsServiceImpl implements IBlogArticleTagsService 
{
    @Autowired
    private BlogArticleTagsMapper blogArticleTagsMapper;

    /**
     * 查询tags
     * 
     * @param articleId tags主键
     * @return tags
     */
    @Override
    public List<Long> selectBlogTagsByArticleId(Long articleId)
    {
        return blogArticleTagsMapper.selectBlogTagsByArticleId(articleId);
    }

    /**
     * 查询tags列表
     * 
     * @param blogArticleTags tags
     * @return tags
     */
    @Override
    public List<BlogArticleTags> selectBlogArticleTagsList(BlogArticleTags blogArticleTags)
    {
        return blogArticleTagsMapper.selectBlogArticleTagsList(blogArticleTags);
    }

    /**
     * 新增tags
     * 
     * @param blogArticleTags tags
     * @return 结果
     */
    @Override
    public int insertBlogArticleTags(BlogArticleTags blogArticleTags)
    {
        return blogArticleTagsMapper.insertBlogArticleTags(blogArticleTags);
    }

    /**
     * 修改tags
     * 
     * @param blogArticleTags tags
     * @return 结果
     */
    @Override
    public int updateBlogArticleTags(BlogArticleTags blogArticleTags)
    {
        return blogArticleTagsMapper.updateBlogArticleTags(blogArticleTags);
    }

    /**
     * 批量删除tags
     * 
     * @param articleIds 需要删除的tags主键
     * @return 结果
     */
    @Override
    public int deleteBlogArticleTagsByArticleIds(Long[] articleIds)
    {
        return blogArticleTagsMapper.deleteBlogArticleTagsByArticleIds(articleIds);
    }

    /**
     * 删除tags信息
     * 
     * @param articleId tags主键
     * @return 结果
     */
    @Override
    public int deleteBlogArticleTagsByArticleId(Long articleId)
    {
        return blogArticleTagsMapper.deleteBlogArticleTagsByArticleId(articleId);
    }

    /**
     * 批量新增tags
     * @param blogArticleTagsDto tags
     * @return 结果
     */
    @Override
    public int batchInsertBlogArticleTags(BlogArticleTagsDto blogArticleTagsDto) {
        return blogArticleTagsMapper.batchInsertBlogArticleTags(blogArticleTagsDto);
    }
}
